import jsYaml from "js-yaml";

export function convertYamlToJson(yml) {
    try {
        const json = jsYaml.load(yml, {});
        this.jsonCode = JSON.stringify(json, null, 2);
        console.log(yml, this.jsonCode);
        return json;
    } catch (e) {
        console.error('转换出错:', e);
    }
}